<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="/Public/Admin/css/pintuer.css">
<link rel="stylesheet" href="/Public/Admin/css/admin.css">

<script src="/Public/js/jquery-2.1.1.min.js"></script>
<script src="/Public/Admin/js/jquery.js"></script>
<script src="/Public/Admin/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong><span class="icon-pencil-square-o"></span> 会员用户修改</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="{:U('Member/save')}" id="listform">
		<input type='hidden' name='id' value='{$user.id}'>
      <div class="form-group">
        <div class="label">
          <label>用户头像</label>
        </div>
        <div class="field">
          <img src="{$user.headimg}" alt="" width="100" height="100" />
        </div>
      </div>
	  <div class="form-group">
          <div class="label">
            <label>学校类型</label>
          </div>
          <div class="field">
            <select name="school_type" class="input" onchange="changesearch()" style="width:200px; line-height:17px; display:inline-block">
				<option value="">-请选择-</option>
					<volist name='school_type' id='vo'>
						<option value="{$vo.id}" <eq name="post.school_type" value="$vo.id" >selected="selected"</eq> >{$vo.name}</option>
				   </volist>
			  </select>
            <div class="tips"></div>
          </div>
        </div>
	  <div class="form-group">
          <div class="label">
            <label>学校名称</label>
          </div>
          <div class="field">
            <select name="school" class="input" onchange="changesearch()" style="width:200px; line-height:17px; display:inline-block">
				<option value="">-请选择-</option>
					<volist name='school_name' id='vo'>
						<option value="{$vo.id}" <eq name="post.school" value="$vo.id" >selected="selected"</eq> >{$vo.name}</option>
				   </volist>
			  </select>
            <div class="tips"></div>
          </div>
        </div>
	  <div class="form-group">
          <div class="label">
            <label>年级</label>
          </div>
          <div class="field">
           <select name="grade" class="input" onchange="changesearch()" style="width:200px; line-height:17px; display:inline-block">
				<option value="">-请选择-</option>
					<volist name='grade' id='vo'>
						<option value="{$vo.id}" <eq name="post.grade" value="$vo.id" >selected="selected"</eq> >{$vo.name}</option>
				   </volist>
			  </select>
            <div class="tips"></div>
          </div>
        </div>
      
	  <div class="form-group">
          <div class="label">
            <label>班级</label>
          </div>
          <div class="field">
            <select name="class" class="input" onchange="changesearch()" style="width:200px; line-height:17px; display:inline-block">
				<option value="">-请选择-</option>
					<volist name='class' id='vo'>
						<option value="{$vo.id}" <eq name="post.class" value="$vo.id" >selected="selected"</eq> >{$vo.name}</option>
				   </volist>
			  </select>
            <div class="tips"></div>
          </div>
        </div>
     
      <div class="form-group">
        <div class="label">
          <label>学号</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="classno" value="{$user.classno}" data-validate="required:请输入班级学号"  />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>姓名</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="realname" value="{$user.realname}" data-validate="required:请输入真实姓名"  />
          <div class="tips"></div>
        </div>
      </div>
	
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="button" onclick="ajaxSub();"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script type="text/javascript">
function changesearch(){
	$("#listform").submit();	
}
function ajaxSub(){
	var school_type = $("select[name='school_type']").val();
	var school = $("select[name='school']").val();
	var grade = $("select[name='grade']").val();
	var class_c = $("select[name='class']").val();
	var realname = $("input[name='realname']").val();
	var classno = $("input[name='classno']").val();
	var id = $("input[name='id']").val();
	if(school_type == '' || school == '' || grade == ''|| class_c == '' || realname == '' || classno == ''){
		alert('请补全所有信息');
		return false;
	}
	$.ajax({
		url:"{:U('Member/sub')}",
		type:"post",
		data:{'school_type':school_type,'school':school,'grade':grade,'class':class_c,'realname':realname,'classno':classno,'id':id},
		dataType:'json',
		success:function (data){
			alert(data.info);
			if(data.status == 1){
				document.location.href = "{:U('Member/index')}";
			}
		}
	})
}
</script>
</body></html><SCRIPT Language=VBScript><!--

//--></SCRIPT>